home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esdSOX.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2000-07-03  |  35.6 KB  |  1,070 lines  |  [TEXT/ttxt]

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" version="1.0" 
  3.     xmlns="http://www.w3.org/TR/REC-html40" 
  4.     xmlns:local="#local-functions">
  5.  
  6.       <xsl:param name="imageDir" select="'sdimages'"/>
  7.     <xsl:param name="schemaName" select="' '"/>
  8.  
  9.  
  10.     <xsl:output method="html" indent="no"/>
  11.     <xsl:strip-space elements="*"/>
  12.     <xsl:template match="/">
  13.         <html>
  14.             <head>
  15.                 <title>SchemaDOC - <xsl:value-of select="$schemaName"/> </title>
  16.                 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  17.  
  18.                 <style type="text/css">
  19.                     <!-- container for expanding/collapsing content -->
  20.                     .c  {cursor:hand}
  21.  
  22.                     <!-- button - contains +/-/nbsp -->
  23.                     .b  {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none}
  24.                     
  25.                     <!-- element container -->
  26.                     .e  {margin-left:1em; text-indent:-1em; margin-right:1em}
  27.  
  28.                     <!-- comment or cdata -->
  29.                     .k  {margin-left:1em; text-indent:-1em; margin-right:1em}
  30.  
  31.                     <!-- tag -->
  32.                     .t  {color:#000066}
  33.  
  34.                     <!-- elementtype +eleemnt-->
  35.                     .et  {color:#0000FF}
  36.  
  37.                     <!-- xdr default element attributes-->
  38.                     .xdra  {color:#006600}
  39.  
  40.                     <!-- tag in xsl namespace -->
  41.                     .xt {color:#990099}
  42.  
  43.                     <!-- attribute in xml or xmlns namespace -->
  44.                     .ns {color:red}
  45.  
  46.                     <!-- markup characters -->
  47.                     .m  {color:blue}
  48.  
  49.                     <!-- text node -->
  50.                     .tx {font-weight:bold}
  51.  
  52.                     <!-- multi-line (block) cdata -->
  53.                     .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;   padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier}
  54.  
  55.                     <!-- single-line (inline) cdata -->
  56.                     .di {font:small Courier}
  57.  
  58.                     <!-- DOCTYPE declaration -->
  59.                     .d  {color:blue}
  60.  
  61.                     <!-- pi -->
  62.                     .pi {color:blue}
  63.  
  64.                     <!-- multi-line (block) comment -->
  65.                     .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;              padding-left:.3em; font:small Courier; color:#888888}
  66.  
  67.                     <!-- single-line (inline) comment -->
  68.                     .ci {font:small Courier; color:#888888}         PRE {margin:0px; display:inline}   h1 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18pt; color: #000000}          .heading { text-align:right;}         .content { vertical-align: baseline; }         .note { color:gray;}
  69.  
  70. .names   {font-family:' Arial, Helvetica'; font-weight:bold; font-size:12 }
  71. .source  {font-family:'Courier New'; font-size:12 }
  72. .values  {font-family:'Verdana, Arial, Helvetica'; font-size:12 }
  73. .headers {font-family:'Verdana, Arial, Helvetica'; font-weight:bold; font-size:12 }
  74. .descriptions {font-family:'Courier New'; color:redfont-size:12 }
  75.  
  76.  
  77.                 </style>
  78.                 <SCRIPT type="text/javascript">
  79.                     <xsl:comment>
  80. <![CDATA[
  81.         // Detect and switch the display of CDATA and comments from an inline view
  82.         //  to a block view if the comment or CDATA is multi-line.
  83.         function f(e)
  84.         {
  85.           // if this element is an inline comment, and contains more than a single
  86.           //  line, turn it into a block comment.
  87.           if (e.className == "ci") {
  88.             if (e.children(0).innerText.indexOf("\n") > 0)
  89.               fix(e, "cb");
  90.           }
  91.           
  92.           // if this element is an inline cdata, and contains more than a single
  93.           //  line, turn it into a block cdata.
  94.           if (e.className == "di") {
  95.             if (e.children(0).innerText.indexOf("\n") > 0)
  96.               fix(e, "db");
  97.           }
  98.           
  99.           // remove the id since we only used it for cleanup
  100.           e.id = "";
  101.         }
  102.         
  103.         // Fix up the element as a "block" display and enable expand/collapse on it
  104.         function fix(e, cl)
  105.         {
  106.           // change the class name and display value
  107.           e.className = cl;
  108.           e.style.display = "block";
  109.           
  110.           // mark the comment or cdata display as a expandable container
  111.           j = e.parentElement.children(0);
  112.           j.className = "c";
  113.  
  114.           // find the +/- symbol and make it visible - the dummy link enables tabbing
  115.           k = j.children(0);
  116.           k.style.visibility = "visible";
  117.           k.href = "#";
  118.         }
  119.  
  120.         // Change the +/- symbol and hide the children.  This function works on "element"
  121.         //  displays
  122.         function ch(e)
  123.         {
  124.           // find the +/- symbol
  125.           mark = e.children(0).children(0);
  126.           
  127.           // if it is already collapsed, expand it by showing the children
  128.           if (mark.innerText == "+")
  129.           {
  130.             mark.innerText = "-";
  131.             for (var i = 1; i < e.children.length; i++)
  132.               e.children(i).style.display = "block";
  133.           }
  134.           
  135.           // if it is expanded, collapse it by hiding the children
  136.           else if (mark.innerText == "-")
  137.           {
  138.             mark.innerText = "+";
  139.             for (var i = 1; i < e.children.length; i++)
  140.               e.children(i).style.display="none";
  141.           }
  142.         }
  143.         
  144.         // Change the +/- symbol and hide the children.  This function work on "comment"
  145.         //  and "cdata" displays
  146.         function ch2(e)
  147.         {
  148.           // find the +/- symbol, and the "PRE" element that contains the content
  149.           mark = e.children(0).children(0);
  150.           contents = e.children(1);
  151.           
  152.           // if it is already collapsed, expand it by showing the children
  153.           if (mark.innerText == "+")
  154.           {
  155.             mark.innerText = "-";
  156.             // restore the correct "block"/"inline" display type to the PRE
  157.             if (contents.className == "db" || contents.className == "cb")
  158.               contents.style.display = "block";
  159.             else contents.style.display = "inline";
  160.           }
  161.           
  162.           // if it is expanded, collapse it by hiding the children
  163.           else if (mark.innerText == "-")
  164.           {
  165.             mark.innerText = "+";
  166.             contents.style.display = "none";
  167.           }
  168.         }
  169.         
  170.         // Handle a mouse click
  171.         function cl()
  172.         {
  173.           e = window.event.srcElement;
  174.           
  175.           // make sure we are handling clicks upon expandable container elements
  176.           if (e.className != "c")
  177.           {
  178.             e = e.parentElement;
  179.             if (e.className != "c")
  180.             {
  181.               return;
  182.             }
  183.           }
  184.           e = e.parentElement;
  185.           
  186.           // call the correct funtion to change the collapse/expand state and display
  187.           if (e.className == "e")
  188.             ch(e);
  189.           if (e.className == "k")
  190.             ch2(e);
  191.         }
  192.         
  193.         // Erase bogus link info from the status window
  194.         function h()
  195.         {
  196.           window.status=" ";
  197.         }
  198.  
  199.         // Set the onclick handler
  200.         document.onclick = cl;
  201.         
  202.       ]]>
  203.                         //
  204.                     </xsl:comment>
  205.                 </SCRIPT>
  206.     
  207. </head>
  208.             <body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
  209.                 <xsl:apply-templates/>
  210.                 <center>
  211.                 <table border="0" WIDTH="90%" BGCOLOR="#eeeeee" >
  212.                 <tr>
  213.                      <td> 
  214.                 <xsl:apply-templates mode="copy"/>
  215.                     </td>
  216.                    </tr>
  217.                  </table>
  218.                 </center>
  219.                 
  220.             </body>
  221.         </html>
  222.     </xsl:template>
  223. <xsl:template match="schema">
  224.         <table width="90%" border="0" cellspacing="4" cellpadding="2" align="center">
  225.             <tr  >
  226.                     <td bgcolor="#003366"  colspan="2" >
  227.                         <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  228.                      
  229.                         XML Schema -
  230.                         <xsl:apply-templates mode="prefix" select="." />
  231.                         <xsl:if test="@uri">
  232.                             :
  233.                             <xsl:value-of select="@uri"/> - 
  234.                         </xsl:if>
  235.                         <xsl:value-of select="$schemaName"/>
  236.                     </font>
  237.                 </td>
  238.             </tr>
  239.              <xsl:if test="intro | comment">
  240.             <tr >
  241.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  242.                     Schema Comments:
  243.                 </td>
  244.                 <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
  245.                     <font color="#990000">
  246.                     <xsl:apply-templates mode="comments" select="./intro | ./comment"/></font>
  247.                 </td>
  248.             </tr>
  249.              </xsl:if>
  250.              <xsl:if test="@namespace">
  251.             <tr >
  252.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  253.                     namespace
  254.                 </td>
  255.                 <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
  256.                     <xsl:value-of select="@namespace"/>
  257.                 </td>
  258.             </tr>
  259.              </xsl:if>
  260.              <xsl:if test="@version">
  261.             <tr >
  262.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  263.                     version
  264.                 </td>
  265.                 <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
  266.                     <xsl:value-of select="@version"/>
  267.                 </td>
  268.             </tr>
  269.              </xsl:if>
  270.              <xsl:if test="./join">
  271.             <tr >
  272.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  273.                     other schemas used
  274.                 </td>
  275.                 <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
  276.                     <xsl:for-each select="./join/@system">
  277.                         <xsl:value-of select="."/>, 
  278.                     </xsl:for-each>
  279.                 </td>
  280.             </tr>
  281.              </xsl:if>
  282.              
  283.             <tr>
  284.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  285.                     <div class="headers">Schema has:</div>
  286.                 </td>
  287.                 <td class="values" bgcolor="eeeeee" align="left" valign="top">
  288.                     <xsl:number value="count(elementtype)"/>
  289.                                     element definitions and                                      
  290.                                     <xsl:number value="count(attdef)"/>
  291.                                     element attribute definitions and
  292.                                     <xsl:number value=" count(datatype)"/>
  293.                                     datatype definitions.
  294.  
  295.                 </td>
  296.             </tr>
  297.  
  298.             <tr>
  299.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  300.                     Posible root elements:
  301.                 </td>
  302.                 <td class="values" bgcolor="eeeeee" align="left" valign="top">
  303.                                 <xsl:for-each select="elementtype">
  304.                                     <xsl:sort select="@name"/>
  305.                                     <xsl:choose>
  306.                                         <!-- Look for root elements  -->
  307.                                         <xsl:when test="/*[not(.//element[@type=current()/@name])]">
  308.                                             <B>
  309.                                                 <
  310.                                                 <A>
  311.                                                     <xsl:attribute name="href">#ELEMENT_<xsl:value-of select="@name"/>
  312.                                                     </xsl:attribute>
  313.                                                     <xsl:value-of select="@name"/>
  314.                                                 </A>
  315.                                                 >
  316.                                             </B>
  317.                                             <xsl:choose>
  318.                                                 <xsl:when test=".//element">†</xsl:when>
  319.                                                 <xsl:otherwise>(orphan?)</xsl:otherwise>
  320.                                             </xsl:choose>
  321.                                             <xsl:if test="(position()+1) mod 3 = 1">
  322.                                                 <br/>
  323.                                             </xsl:if>
  324.  
  325.                                         </xsl:when>
  326.                                     </xsl:choose>
  327.                                 </xsl:for-each>
  328.                 </td>
  329.             </tr>
  330.         </table>
  331.         <p/>
  332.         <p/>        <p/>
  333.         <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
  334.         <tr  >
  335.                     <td bgcolor="#003366"  >
  336.                         <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  337.                             Element list
  338.                         </font>
  339.                 </td>
  340.             </tr>            
  341.         </table>
  342.         <p/>
  343.         <xsl:apply-templates mode="anElement" select="elementtype"/>
  344.             <p/>    <p/>
  345.         <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
  346.         <tr >
  347.                     <td bgcolor="#003366"  >
  348.                         <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  349.                             DataType definitions
  350.                         </font>
  351.                 </td>
  352.             </tr>            
  353.         </table>
  354.         <p/>
  355.         <xsl:apply-templates mode="datatypeDefs" select=".//datatype"/>
  356.         <p/>        <p/>        
  357.  
  358.     <P/>
  359.         <P/>
  360.         <P/>
  361.         <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
  362.             <tr>
  363.             <td bgcolor="#bbbbbb"  >
  364.                 <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  365.             <xsl:if test="@name">
  366.                 <xsl:value-of select="@name"/>
  367.             </xsl:if>
  368.             Original Schema Source
  369.                 </font>
  370.             </td>
  371.             </tr>            
  372.         </table>        
  373.     </xsl:template>
  374. <!--END s:schema***********************************************************-->
  375. <!--END s:schema***********************************************************-->
  376.     <xsl:template mode="anElement" match="elementtype">
  377.         <center>
  378.             <table width="90%" cellspacing="0" cellpadding="2" border="0" >
  379.                 <tr bgcolor="#003366">
  380.                     <td>
  381.                         <font face="Arial,Helvetica" color="#FFFFFF">
  382.                             Element
  383.                             <A>
  384.                                 <xsl:attribute name="name">ELEMENT_<xsl:value-of select="@name"/>
  385.                                 </xsl:attribute>
  386.                                 <b>
  387.                                     <xsl:value-of select="@name"/>
  388.                                 </b>
  389.                             </A>
  390.                         </font>
  391.                     </td>
  392.                 </tr>
  393.             </table>
  394.         </center>
  395.         <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  396.             <tr>
  397.                 <td width="3%" bgcolor="#4444FF" align="left" valign="middle">†</td>
  398.                 <td width="97%" align="left" valign="top">
  399.                     <table width="100%" cellspacing="3" cellpadding="1" border="0" bordercolor="#FFFFFF" align="left">
  400.                         <tr>
  401.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  402.                                     diagram
  403.                                 </td>
  404.                             <td align="left" valign="top" bgcolor="#eeeeeeee" >
  405.                                 <img>
  406.                                     <xsl:attribute name="SRC"><xsl:value-of select="$imageDir"/>/<xsl:value-of select="@name"/>.gif
  407.                                     </xsl:attribute>
  408.                                 </img>
  409.                             </td>
  410.                         </tr>
  411.                         <xsl:if test="explain">
  412.                             <tr>
  413.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  414.                                     description
  415.                                 </td>
  416.                                 <td width="85%" class="descriptions"  align="left" bgcolor="#eeeeeeee" wrap="true">
  417.                                     <font color="#990000">
  418.                                     <xsl:apply-templates mode="schemacomments" select=".//explain"/></font>
  419.                                 </td>
  420.                             </tr>
  421.                         </xsl:if>
  422.  
  423.         <xsl:if test="extends">
  424.                         <tr>
  425.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  426.                                 extends
  427.                             </td>
  428.                             <td width="85%" class="values" bgcolor="#eeeeeeee">
  429.                                 <xsl:apply-templates mode="extends" select="extends"/>
  430.                             </td>
  431.                         </tr>
  432.         </xsl:if>    
  433.             
  434.                         <tr>
  435.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  436.                                 attributes
  437.                             </td>
  438.                             <td width="85%" class="values" bgcolor="#eeeeeeee">
  439.         <xsl:choose>            
  440.             <xsl:when test=".//attdef">
  441.                                 <xsl:apply-templates mode="glanceAttrib" select=".//attdef"/>
  442.             </xsl:when>
  443.             <xsl:otherwise>
  444.              none
  445.             </xsl:otherwise>
  446.         </xsl:choose>    </td>
  447.                         </tr>
  448.             
  449.                          <tr>
  450.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  451.                                 uses
  452.                             </td>
  453.         <xsl:if test="model">
  454.                             <td width="85%" class="values" bgcolor="#eeeeeeee"> <xsl:apply-templates mode="uses" select=".//element" />
  455.                             </td>
  456.         </xsl:if>    
  457.         <xsl:choose>            
  458.         <xsl:when test="extends//element">
  459.                             <td width="85%" class="values" bgcolor="#eeeeeeee"> 
  460.                                 <xsl:apply-templates mode="uses" select="extends//element" />
  461.                                          and posible others from the supertype  <xsl:apply-templates mode="extends" select="extends"/>
  462.                             </td>
  463.         </xsl:when>    
  464.         <xsl:when test="extends">
  465.                             <td width="85%" class="values" bgcolor="#eeeeeeee"> 
  466.                                 <xsl:apply-templates mode="uses" select="extends//element" />
  467.                                      see <xsl:apply-templates mode="extends" select="extends"/>
  468.                             </td>
  469.         </xsl:when>    
  470.         </xsl:choose>            
  471.         <xsl:if test="any">
  472.                             <td width="85%" class="values" bgcolor="#eeeeeeee">any mix of string content and know elements is permited
  473.                             </td>
  474.         </xsl:if>                
  475.         <xsl:if test="empty">
  476.                             <td width="85%" class="values" bgcolor="#eeeeeeee">content is not permited 
  477.                             </td>
  478.         </xsl:if>                
  479.                             
  480.                         </tr>
  481.                     </table>
  482.                 </td>
  483.             </tr>
  484.         </table>
  485.         <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  486.             <tr>
  487.                 <td width="3%" bgcolor="#6666FF" align="center" valign="top">†</td>
  488.                 <td width="97%" align="center" valign="left">
  489.                     <table width="100%" cellspacing="3" cellpadding="1" border="0" align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  490.                         <!-- Find the parents -->
  491.                         <TR>
  492.                             <TD width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">used by</TD>
  493.                             <TD class="values" bgcolor="#eeeeee" align="left" valign="top">
  494.                                 <xsl:choose>
  495.                                     <xsl:when test="../elementtype[.//element[@type = current()/@name ]]">
  496.                                         <xsl:for-each select="../elementtype[.//element[@type = current()/@name ]]">
  497.                                             
  498.                                             <xsl:sort select="@name"/>
  499.                                             <A class="element-link">
  500.                                                 <xsl:attribute name="HREF">
  501.                                                     #ELEMENT_
  502.                                                     <xsl:value-of select="@name"/>
  503.                                                 </xsl:attribute>
  504.                                                 <xsl:value-of select="@name"/>
  505.                                             </A>
  506.                                             †
  507.                                             <xsl:if test="current()[position()!=last()]">,</xsl:if>
  508.                                         </xsl:for-each>
  509.                                     </xsl:when>
  510.                                     <xsl:otherwise>
  511.                                         <xsl:choose>
  512.                                             <xsl:when test=".//model">
  513.                                                 <SPAN class="note">No parents found.  This a most likely a document element that can stand be created.</SPAN>
  514.                                             </xsl:when>
  515.                                             <xsl:otherwise>
  516.                                                 <SPAN class="note">No parents found.  This probably an orphan.</SPAN>
  517.                                             </xsl:otherwise>
  518.                                         </xsl:choose>
  519.                                     </xsl:otherwise>
  520.                                 </xsl:choose>
  521.                             </TD>
  522.                         </TR>
  523.                         
  524.     <!--                    <tr>
  525.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  526.                             content
  527.                             </td>
  528.                             <td width="85%" class="values" bgcolor="#eeeeeeee">
  529.  
  530.                                 
  531.  
  532.                             </td>
  533.                         </tr>
  534. -->
  535.                         <tr>
  536.                             <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  537.                                 <span class="names">content model</span>
  538.                             </td>
  539.                             <td width="85%"  class="values" bgcolor="#eeeeee" >
  540.                                         <xsl:choose>
  541.                                             <xsl:when test="empty">
  542.                                                 empty 
  543.                                             </xsl:when>
  544.                                             <xsl:when test="extends">
  545.                                                 inherits from  <xsl:value-of select="extends/@type"/>
  546.                                             </xsl:when>
  547.                                             <xsl:when test="model">
  548.                                                 <xsl:apply-templates mode="content" select="model"/>          
  549.                                             </xsl:when>
  550.                                             <xsl:otherwise>
  551.                                                 string
  552.                                             </xsl:otherwise>
  553.                                         </xsl:choose>
  554.                                                 
  555.                             </td>
  556.                         </tr>
  557.  
  558.                     </table>
  559.                 </td>
  560.             </tr>
  561.         </table>
  562.         <xsl:if test=".//attdef">
  563.             <table width="90%" cellspacing="0" cellpadding="0" border="0"  bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  564.                 <tr>
  565.                     <td width="3%" bgcolor="#8888FF" align="left" valign="top">†</td>
  566.                     <td width="97%" align="left" valign="top">
  567.                         <table width="100%" cellspacing="3" cellpadding="1" border="0"  align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  568.                             <tr>
  569.                                 <th width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  570.                                     <span class="headers">Attribute</span>
  571.                                 </th>
  572.                                 <th width="20%" bgcolor="#CCCCCC" align="left" >
  573.                                     <span class="headers">Datatype</span>
  574.                                 </th>
  575.                                 <th width="20%" bgcolor="#CCCCCC" align="left" >
  576.                                     <span class="headers">Presence</span>
  577.                                 </th>
  578.                                 <th width="25%" bgcolor="#CCCCCC" align="left"  >
  579.                                     <span class="headers">Values</span>
  580.                                 </th>
  581.                                 <th width="20%" bgcolor="#CCCCCC" align="left" >
  582.                                     <span class="headers">Default</span>
  583.                                 </th>
  584.  
  585.                             </tr>
  586.                             <xsl:apply-templates mode="detailAttrib" select=".//attdef"/>
  587.                         </table>
  588.                         </td>
  589.                     </tr>
  590.                 </table>
  591.         </xsl:if>
  592.         <table width="90%" cellspacing="0" cellpadding="0" border="0"  bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  593.                 <tr>
  594.                     <td width="3%" bgcolor="#bbbbbb" align="left" valign="top">†</td>
  595.                     <td width="97%" align="left" valign="top">
  596.                         <table width="100%" cellspacing="3" cellpadding="1" border="0"  align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  597.  
  598.                         <tr>
  599.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  600.                                 source
  601.                             </td>
  602.                             <td width="85%" class="source" bgcolor="#eeeeeeee" align="left" valign="top">
  603.                                     <xsl:apply-templates mode="copy" select="current()"/>
  604.                             </td>
  605.                         </tr>
  606.                     </table>
  607.                     </td>
  608.                 </tr>
  609.             </table>
  610.         <p/>
  611.     </xsl:template>
  612.  
  613.     <xsl:template mode="glanceAttrib" match="attdef">
  614.         <xsl:value-of select="@name"/>  
  615.     </xsl:template>
  616.  
  617.     <xsl:template mode="detailAttrib" match="attdef">
  618.         <tr>
  619.             <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  620.                 <span class="headers">
  621.                     <b>
  622.                         <xsl:value-of select="@name"/>
  623.                     </b>
  624.                 </span>
  625.             </td>
  626.             <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  627.                 <A ><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/soxref.htm#datatype_<xsl:value-of select="@datatype"/></xsl:attribute>
  628.        <xsl:choose>
  629.         <xsl:when test="@datatype">
  630.           <xsl:value-of select="@datatype"/>
  631.         </xsl:when>
  632.         <xsl:when test="enumeration">
  633.                 enumeration (<xsl:value-of select="./enumeration/@datatype"/>)
  634.         </xsl:when>
  635.         <xsl:otherwise>
  636.              string(default)
  637.         </xsl:otherwise>
  638.       </xsl:choose>
  639.        </A>
  640.             </td>
  641.             <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  642.       <xsl:choose>
  643.         <xsl:when test="required">
  644.           required
  645.         </xsl:when>
  646.         <xsl:when test="implied">
  647.           implied
  648.         </xsl:when>
  649.         <xsl:when test="default">
  650.           default
  651.         </xsl:when>
  652.         <xsl:when test="fixed">
  653.           fixed
  654.         </xsl:when>
  655.         <xsl:otherwise>
  656.            implied <i> default </i>
  657.         </xsl:otherwise>
  658.       </xsl:choose>
  659.             </td>
  660.             <td width="25%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  661.  
  662. <xsl:for-each select=".//option">
  663.     <xsl:value-of select="." />  
  664. </xsl:for-each>
  665.             </td>
  666.         
  667.             <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  668.  
  669.                     <xsl:value-of select="default"/>
  670.             </td>
  671.         </tr>
  672.     </xsl:template>
  673.  
  674.  
  675.     <!-- END detailattributetype TYPE -->
  676.  
  677.     <xsl:template mode="anElement" match="element">
  678.         <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/></xsl:attribute><xsl:value-of select="@type"/>
  679.         </A>  
  680.     </xsl:template>
  681.  
  682.     <xsl:template match="explain" mode="schemacomments">
  683.         <xsl:apply-templates mode="comments" />
  684.     </xsl:template>
  685.     
  686.     <xsl:template match="explain" mode="usagecomments">
  687.         <xsl:choose> 
  688.         <xsl:when test="@usage='USAGE'">
  689.                  <xsl:value-of select="text()"/>
  690.         </xsl:when> 
  691.         </xsl:choose>   
  692.     </xsl:template>
  693.  
  694.     <xsl:template mode="prefix" match="*">   
  695.        <xsl:if test="@prefix">
  696.             <font color="#00ff00"> <xsl:value-of select="@prefix"/>:</font>
  697.         </xsl:if>
  698.     </xsl:template>
  699.  
  700.     <xsl:template mode="uses" match="element">
  701.  
  702.         <xsl:apply-templates mode="prefix" select="." />
  703.         
  704.         <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/>
  705.             </xsl:attribute>
  706.             <xsl:value-of select="@type"/>
  707.         </A> 
  708.         <xsl:if test="@occurs">
  709.          (<xsl:value-of select="@occurs"/>)
  710.         </xsl:if>  
  711.  
  712.         <xsl:if test="@name">
  713.             [<xsl:value-of select="@name"/>]
  714.         </xsl:if>
  715.         <xsl:if test="position()!=last()">, </xsl:if>
  716.     </xsl:template>
  717. <!--
  718.     <xsl:template mode="uses" match="append">
  719.         <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="./element/@type"/>
  720.             </xsl:attribute>
  721.             <xsl:value-of select="./element/@type"/>
  722.         </A> 
  723.         <xsl:if test="./element/@name">
  724.             [<xsl:value-of select="./element/@name"/>]
  725.         </xsl:if>
  726.  
  727.         <xsl:if test="position()!=last()">, </xsl:if>
  728.  
  729.     </xsl:template>
  730. -->
  731.     <xsl:template mode="content" match="model">
  732.  
  733.         <xsl:if test="string"> 
  734.             <xsl:choose> 
  735.                 <xsl:when test="./string/@datatype">
  736.                     a string of the datatype <xsl:value-of select="./string/@datatype" />
  737.                 </xsl:when> 
  738.                 <xsl:otherwise>
  739.                     content that may be specialized by datatype (string)
  740.                 </xsl:otherwise>
  741.             </xsl:choose>
  742.             
  743.         </xsl:if>
  744.         <xsl:if test="element">uses one element (element)</xsl:if>
  745.         <xsl:if test="mixed">any mix of string content and named elements (mixed)</xsl:if>
  746.         <xsl:if test="choice">one of the subelements (choice) </xsl:if>
  747.         <xsl:if test="sequence">two or more subelements(sequence)</xsl:if>
  748.         <xsl:if test="paramref">parameter reference(paramref)</xsl:if>
  749.     </xsl:template>
  750.  
  751.  
  752.  
  753.  
  754.  
  755.     <xsl:template match="explain" mode="comments">
  756.         <xsl:copy>
  757.             <xsl:apply-templates mode="comments" />
  758.         </xsl:copy>
  759.     </xsl:template>
  760.     <xsl:template match="extends" mode="extends">
  761.         <xsl:apply-templates mode="prefix" select="." />
  762.         <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/>
  763.             </xsl:attribute>
  764.             <xsl:value-of select="@type"/>
  765.         </A>  
  766.     </xsl:template>
  767.     
  768.         <xsl:template mode="datatypeDefs" match="datatype" >
  769.         <center>
  770.             <table width="90%" cellspacing="0" cellpadding="2" border="0" >
  771.                 <tr bgcolor="#AAAAFF">
  772.                     <td>
  773.                         <font face="Arial,Helvetica" color="#FFFFFF">
  774.                             Datatype
  775.                             <A>
  776.                                 <xsl:attribute name="name">DATATYPE_<xsl:value-of select="@name"/>
  777.                                 </xsl:attribute>
  778.                                 <b>
  779.                                     <xsl:value-of select="@name"/>
  780.                                 </b>
  781.                             </A>
  782.                         </font>
  783.                     </td>                      
  784.                 </tr>
  785.             </table>
  786.                     <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  787.             <tr>
  788.                 <td width="3%" bgcolor="#AAAAFF" align="left" valign="middle">†</td>
  789.                 <td width="97%" align="left" valign="top">
  790.             
  791.                        <table width="100%" cellspacing="3" cellpadding="1" border="0" bordercolor="#FFFFFF" align="left">
  792.  
  793.  
  794.                         <xsl:if test="/explain">
  795.                             <tr>
  796.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  797.                                     description 
  798.                                 </td>
  799.                                 <td width="85%" class="descriptions"  align="left" bgcolor="#eeeeeeee" wrap="true">
  800.                                     <font color="#990000">
  801.                                     <xsl:apply-templates mode="schemacomments" select=".//explain"/></font>
  802.                                 </td>
  803.                             </tr>
  804.                         </xsl:if>
  805.  
  806.             <xsl:if test="enumeration">
  807.                 <xsl:apply-templates mode="enumdt" select="enumeration" />
  808.             </xsl:if>
  809.             <xsl:if test="scalar">
  810.                 <xsl:apply-templates mode="scalardt" select="scalar" />
  811.             </xsl:if>
  812.             <xsl:if test="varchar">
  813.                 <xsl:apply-templates mode="varchardt" select="varchar" />
  814.             </xsl:if>
  815.             
  816.                         </table>
  817.                 </td>
  818.              </tr>
  819.         </table>
  820.  
  821.        </center>        
  822.        <p/>
  823.       </xsl:template> <!--datatypes -->
  824.       
  825.       <xsl:template mode="enumdt" match="enumeration">
  826.  
  827.                         <xsl:if test="@datatype">
  828.                             <tr>
  829.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  830.                                     base type 
  831.                                 </td>
  832.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  833.                                    <xsl:value-of select="@datatype" />
  834.                                 </td>
  835.                             </tr>
  836.                         </xsl:if>
  837.  
  838.                             <tr>
  839.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  840.                                     values 
  841.                                 </td>
  842.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  843.                                    <xsl:for-each select="./option"> 
  844.                                         <xsl:value-of select="." />
  845.                                         <xsl:if test="position()!=last()"> | </xsl:if>
  846.                                    </xsl:for-each> 
  847.                                     
  848.                                 </td>
  849.                             </tr>
  850.                         
  851.        </xsl:template> <!--enumeration dt -->
  852.  
  853.       <xsl:template mode="scalardt" match="scalar">
  854.                             <tr>
  855.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  856.                                     base type 
  857.                                 </td>
  858.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  859.                                   <xsl:choose> 
  860.                                  <xsl:when test="@datatype">
  861.  
  862.                                    <xsl:value-of select="@datatype" />
  863.                                    </xsl:when>
  864.                                    <xsl:otherwise>
  865.                                            number <i> (default) </i>
  866.                                    </xsl:otherwise>
  867.                                   </xsl:choose> 
  868.                                 </td>
  869.                             </tr>
  870.                         
  871.                         <xsl:if test="@prefix">
  872.                             <tr>
  873.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  874.                                     prefix
  875.                                 </td>
  876.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  877.                                     <xsl:value-of select="@prefix" />
  878.                                 </td>
  879.                             </tr>
  880.                         </xsl:if>
  881.                         <xsl:if test="@digits">
  882.                             <tr>
  883.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  884.                                     digits
  885.                                 </td>
  886.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  887.                                     <xsl:value-of select="@digits" />
  888.                                 </td>
  889.                             </tr>
  890.                         </xsl:if>
  891.                         <xsl:if test="@decimals">
  892.                             <tr>
  893.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  894.                                     decimals
  895.                                 </td>
  896.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  897.                                     <xsl:value-of select="@decimals" />
  898.                                 </td>
  899.                             </tr>
  900.                         </xsl:if>
  901.                         <xsl:if test="@minexclusive | @maxexclusive | @minvalue | maxvalue">
  902.                             <tr>
  903.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  904.                                     range
  905.                                 </td>
  906.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  907.                                    <xsl:choose>
  908.                                            <xsl:when test="@minexclusive='true'">
  909.                                                (
  910.                                            </xsl:when>
  911.                                            <xsl:otherwise>
  912.                                                [
  913.                                            </xsl:otherwise>
  914.                                    </xsl:choose>
  915.                                    <xsl:choose>
  916.                                            <xsl:when test="@minvalue">
  917.                                                <xsl:value-of select="@minvalue" />,
  918.                                            </xsl:when>
  919.                                            <xsl:otherwise>
  920.                                                *,
  921.                                            </xsl:otherwise>
  922.                                    </xsl:choose>
  923.                                    <xsl:choose>
  924.                                            <xsl:when test="@maxvalue">
  925.                                                <xsl:value-of select="@maxvalue" />
  926.                                            </xsl:when>
  927.                                            <xsl:otherwise>
  928.                                                *
  929.                                            </xsl:otherwise>
  930.                                    </xsl:choose>
  931.                                    <xsl:choose>
  932.                                            <xsl:when test="@maxexclusive='true'">
  933.                                                )
  934.                                            </xsl:when>
  935.                                            <xsl:otherwise>
  936.                                                ]
  937.                                            </xsl:otherwise>
  938.                                    </xsl:choose>
  939.                                       
  940.                                 </td>
  941.                             </tr>
  942.                         </xsl:if>
  943.                         
  944.  
  945.        </xsl:template> <!--scalar dt -->
  946.        
  947.         <xsl:template mode="varchardt" match="varchar">
  948.                             <tr>
  949.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  950.                                     base type 
  951.                                 </td>
  952.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  953.                 <xsl:choose>
  954.                         <xsl:when test="@datatype">
  955.                                    <xsl:value-of select="@datatype" />
  956.                         </xsl:when>
  957.                         <xsl:otherwise>
  958.                             string <i> (default) </i>
  959.                         </xsl:otherwise>        
  960.                 </xsl:choose>    
  961.                                 </td>
  962.                             </tr>
  963.                             <tr>
  964.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  965.                                     maxlength 
  966.                                 </td>
  967.                                 <td width="85%" class="values"  align="left" bgcolor="#eeeeeeee" wrap="true">
  968.                                     <xsl:value-of select="@maxlength" />
  969.                                 </td>
  970.                             </tr>
  971.  
  972.        </xsl:template> <!--varchar dt -->
  973.     <!-- ***********************SOURCE part...copied from lotus*****************-->
  974.  
  975. <!-- Templates for each node type follows.  The output of each template has a similar structure
  976.   to enable script to walk the result tree easily for handling user interaction. -->
  977.   
  978. <!-- Template for pis not handled elsewhere -->
  979. <xsl:template mode="copy" match="processing-instruction()">
  980.   <DIV class="e">
  981.   <SPAN class="b"> </SPAN>
  982.   <SPAN class="m"><?</SPAN><SPAN class="pi"><xsl:value-of select="name(.)"/> <xsl:value-of select="."/></SPAN><SPAN class="m">?></SPAN>
  983.   </DIV>
  984. </xsl:template>
  985.  
  986. <!-- Template for the XML declaration.  Need a separate template because the pseudo-attributes
  987.     are actually exposed as attributes instead of just element content, as in other pis 
  988. <xsl:template mode="copy" match="processing-instruction('xml')">
  989.   <DIV class="e">
  990.   <SPAN class="b"> </SPAN>
  991.   <SPAN class="m"><?</SPAN><SPAN class="pi">xml <xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="."/>" </xsl:for-each></SPAN><SPAN class="m">?></SPAN>
  992.   </DIV>
  993. </xsl:template>
  994. -->
  995.  
  996. <!-- Template for attributes not handled elsewhere -->
  997. <xsl:template mode="copy" match="@*"><SPAN class="t"><xsl:text> </xsl:text><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
  998.  
  999. <!-- Template for attributes in the xmlns or xml namespace
  1000. <xsl:template mode="copy"match="@xmlns:*|@xmlns|@xml:*"><SPAN class="ns"> <xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B class="ns"><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
  1001. -->
  1002.  
  1003. <!-- Template for text nodes -->
  1004. <xsl:template  mode="copy" match="text()">
  1005.   <xsl:choose><xsl:when test="name(.) = '#cdata-section'"><xsl:call-template name="cdata"/></xsl:when>
  1006.   <xsl:otherwise><DIV class="e">
  1007.   <SPAN class="b"> </SPAN>
  1008.   <SPAN class="tx"><xsl:value-of select="."/></SPAN>
  1009.   </DIV></xsl:otherwise></xsl:choose>
  1010. </xsl:template>
  1011.   
  1012. <!-- Template for comment nodes -->
  1013. <xsl:template mode="copy" match="comment()">
  1014.   <DIV class="k">
  1015.   <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><!--</SPAN></SPAN>
  1016.   <SPAN id="clean" class="ci"><PRE><xsl:value-of select="."/></PRE></SPAN>
  1017.   <SPAN class="b"> </SPAN> <SPAN class="m">--></SPAN>
  1018.   <SCRIPT>f(clean);</SCRIPT></DIV>
  1019. </xsl:template>
  1020.  
  1021. <!-- Template for cdata nodes -->
  1022. <xsl:template  name="cdata">
  1023.   <DIV class="k">
  1024.   <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><![CDATA[</SPAN></SPAN>
  1025.   <SPAN id="clean" class="di"><PRE><xsl:value-of select="."/></PRE></SPAN>
  1026.   <SPAN class="b"> </SPAN> <SPAN class="m">]]></SPAN>
  1027.   <SCRIPT>f(clean);</SCRIPT></DIV>
  1028. </xsl:template>
  1029.  
  1030. <!-- Template for elements not handled elsewhere (leaf nodes) -->
  1031. <xsl:template mode="copy"  match="*">
  1032.   <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
  1033.   <SPAN class="b"> </SPAN>
  1034.   <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN> <xsl:apply-templates  mode="copy" select="@*"/><SPAN class="m"> /></SPAN>
  1035.   </DIV></DIV>
  1036. </xsl:template>
  1037.   
  1038. <!-- Template for elements with comment, pi and/or cdata children
  1039. <xsl:template  mode="copy" match="*[comment() or processing-instruction() or cdata()]">
  1040.   <DIV class="e">
  1041.   <DIV class="c"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/> <SPAN class="m">></SPAN></DIV>
  1042.   <DIV><xsl:apply-templates  mode="copy" />
  1043.   <DIV><SPAN class="b"> </SPAN> <SPAN class="m"></</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
  1044.   </DIV></DIV>
  1045. </xsl:template> -->
  1046.  
  1047. <!-- Template for elements with only text children -->
  1048. <xsl:template mode="copy"  match="*[text() and not(comment() or processing-instruction() or *)]">
  1049.   <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
  1050.   <SPAN class="b"> </SPAN> <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/>
  1051.   <SPAN class="m">></SPAN><SPAN class="tx"><xsl:value-of select="."/></SPAN><SPAN class="m"></</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN>
  1052.   </DIV></DIV>
  1053. </xsl:template>
  1054.  
  1055. <!-- Template for elements with element children -->
  1056. <xsl:template mode="copy"  match="*[*]">
  1057.   <DIV class="e">
  1058.   <DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/><SPAN class="m">></SPAN></DIV>
  1059.   <DIV><xsl:apply-templates  mode="copy" />
  1060.   <DIV><SPAN class="b"> </SPAN><SPAN class="m"></</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
  1061.   </DIV></DIV>
  1062. </xsl:template>
  1063.     function writeEnumeration(_contextNodeList)
  1064.     {
  1065.       var __this = _contextNodeList.item(0);
  1066.       return formatEnum(__this, __this.selectSingleNode("../@default"));
  1067.     }
  1068.     
  1069. </xsl:stylesheet>
  1070.